from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

#调用驱动，打开Chrome浏览器
driver = webdriver.Chrome()
sleep(2)
#输入网址,打开meethere网站
driver.get("http://118.121.200.162:8085/index")
sleep(2)
driver.find_element(By.CSS_SELECTOR,"#navbar > div > ul > li:nth-child(1) > a").click()
sleep(2)

driver.find_element(By.CSS_SELECTOR,"#userID").send_keys("Razor0127")
sleep(2)
driver.find_element(By.CSS_SELECTOR,"#password").send_keys("py324832")
sleep(2)
driver.find_element(By.CSS_SELECTOR,"#submit").click()
sleep(2)

driver.switch_to.alert.accept()
sleep(2)

action1 = driver.find_element(By.XPATH,"//*[@id='navbar']/div/ul/li[1]/a/p").text
driver.find_element(By.CSS_SELECTOR,"#navbar > div > ul > li:nth-child(1) > a > p").click()
yanz = driver.find_element(By.CSS_SELECTOR,"#userName").get_attribute("value")

assert action1 in yanz

